#include <WiFi.h>
#include "ota.h"

/* 连接WIFI SSID和密码 */
#define WIFI_SSID         "425"
#define WIFI_PASSWD       "425425425"

//连接wifi
void wifiInit()
{
    WiFi.begin(WIFI_SSID,WIFI_PASSWD);
    while (WiFi.status() != WL_CONNECTED)
    {
        delay(1000);
        Serial.println("WiFi not Connect");
    }
    Serial.println(WiFi.SSID());
    Serial.println(WiFi.localIP());
 }

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("System Start");
  wifiInit();
}
long otaInterval = 0;
void loop() {
    if (millis() - otaInterval >= 60000) {
      //循环时间，不要少于1分钟(60000)，否则会失败
      otaInterval = millis();
      httpGetOTA();
    }
}
